package com.singlemusic.service.impl;

import java.io.Serializable;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.singlemusic.dao.BaseDao;
import com.singlemusic.service.IBaseService;

@Service(value="baseService")
public class BaseServiceImpl<T> implements IBaseService<T> {
	@Resource(name="baseDao")
	private BaseDao<T> baseDao;
	@Override
	public boolean add(T t) {
		return baseDao.add(t);
	}

	@Override
	public boolean delete(T t) {
		return baseDao.delete(t);
	}

	@Override
	public List<T> findAll(Class<T> c) {
		return baseDao.findAll(c);
	}

	@Override
	public boolean update(T t) {
		return baseDao.update(t);
	}

	@Override
	public boolean merge(T t) {
		return baseDao.merge(t);
	}

	@Override
	public T findById(Class<T> c, Serializable id) {
		return baseDao.findByID(c, id);
	}

	@Override
	public List<T> findByHql(String hql, String[] param) {
		return baseDao.findByHql(hql, param);
	}

	@Override
	public List<T> findBySql(Class<T> c, String sql, String[] param) {
		return baseDao.findBySql(c, sql, param);
	}

	@Override
	public List<T> findByPage(String hql, String[] param, int page, int row) {
		return baseDao.findByPage(hql, param, page, row);
	}

	@Override
	public int getResultCount(String hql, String[] param) {
		return baseDao.getResultCount(hql, param);
	}

}
